<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="../../../../WEB-INF/myTag.tld" prefix="my"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>人员布控列表</title>
    <link href="<%=request.getContextPath()%>/views/sysdefault/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
    <link href="<%=request.getContextPath()%>/views/sysdefault/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="<%=request.getContextPath()%>/views/sysdefault/css/animate.min.css" rel="stylesheet">
    <link href="<%=request.getContextPath()%>/views/sysdefault/css/style.min.css?v=4.0.0" rel="stylesheet">
    <link href="<%=request.getContextPath()%>/views/sysdefault/css/plugins/toastr/toastr.min.css" rel="stylesheet">
    <link href="<%=request.getContextPath()%>/views/sysdefault/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    
    <link href="<%=request.getContextPath()%>/views/sysdefault/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
	
</head>

<body class="gray-bg">
    <!-- 分页 -->
	<form id="pagerForm" method="post" action="listPersonMonitor.do">
		<input type="hidden" name="currentPage" id="currentPage" value="1" />
		<input type="hidden" name="name" value="${dataStore.name}" />
		<input type="hidden" name="idCard" value="${dataStore.idCard}" />
		<input type="hidden" name="status" value="${dataStore.status}" />
		<input type="hidden" name="thing" value="${dataStore.thing}" />
		<input type="hidden" name="type" value="${dataStore.type}" />
		<input type="hidden" name="level" value="${dataStore.level}" />
		<input type="hidden" name="start" value="${dataStore.start}" />
		<input type="hidden" name="end" value="${dataStore.end}" />
		<input type="hidden" name="start2" value="${dataStore.start2}" />
		<input type="hidden" name="end2" value="${dataStore.end2}" />
	</form>
	
	<!-- 导出 -->
	<form id="export" method="post" action="personMonitor.do">
		<input type="hidden" name="name" value="${dataStore.name}" />
		<input type="hidden" name="idCard" value="${dataStore.idCard}" />
		<input type="hidden" name="status" value="${dataStore.status}" />
		<input type="hidden" name="thing" value="${dataStore.thing}" />
		<input type="hidden" name="type" value="${dataStore.type}" />
		<input type="hidden" name="level" value="${dataStore.level}" />
		<input type="hidden" name="start" value="${dataStore.start}" />
		<input type="hidden" name="end" value="${dataStore.end}" />
		<input type="hidden" name="start2" value="${dataStore.start2}" />
		<input type="hidden" name="end2" value="${dataStore.end2}" />
	</form>
    
    <div class="wrapper wrapper-content animated fadeInRight">
    	<div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>人员布控列表</h5>
                        <div class="ibox-tools">
                            <a class="collapse-link">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                    
                    	<!-- 搜索区 -->
                    	<div class="m-b-sm">
                    	<form id="newsList" name="newsList" action="listPersonMonitor.do" method="post">
                    	
                    	<div class="col-lg-2 m-b-sm">
                    		<div class="input-group">
                    			<span class="input-group-addon">人员姓名:</span>
								<input type="text" class="form-control" name="name" value="${dataStore.name}"/>
							</div>
						</div>
						
						<div class="col-lg-2 m-b-sm">
                    		<div class="input-group">
                    			<span class="input-group-addon">证件号码:</span>
								<input type="text" class="form-control" name="idCard" value="${dataStore.idCard}"/>
							</div>
						</div>
						
						<div class="col-lg-2 m-b-sm">
							<div class="input-group">
							<span class="input-group-addon">当前状态:</span>
							<select name="status" class="form-control">
								<option value="">所有</option>
								<option value="1" <c:if test="${dataStore.status == '1'}">selected="selected"</c:if> >未布控</option>
								<option value="2" <c:if test="${dataStore.status == '2'}">selected="selected"</c:if> >已布控</option>
								<option value="3" <c:if test="${dataStore.status == '3'}">selected="selected"</c:if> >布控到期</option>
								<option value="4" <c:if test="${dataStore.status == '4'}">selected="selected"</c:if> >延控</option>
								<option value="5" <c:if test="${dataStore.status == '5'}">selected="selected"</c:if> >已撤控</option>
							</select>
							</div>
						</div>
						
						<div class="col-lg-2 m-b-sm">
							<div class="input-group">
							<span class="input-group-addon">布控事由:</span>
							<select name="thing" class="form-control">
								<option value="">所有</option>
								<option value="1" <c:if test="${dataStore.thing == '1'}">selected="selected"</c:if> >涉事</option>
								<option value="2" <c:if test="${dataStore.thing == '2'}">selected="selected"</c:if> >涉稳</option>
								<option value="3" <c:if test="${dataStore.thing == '3'}">selected="selected"</c:if> >涉案</option>
								<option value="4" <c:if test="${dataStore.thing == '4'}">selected="selected"</c:if> >关系人</option>
							</select>
							</div>
						</div>
						
						<div class="col-lg-2 m-b-sm">
							<div class="input-group">
							<span class="input-group-addon">布控类型:</span>
							<select name="type" class="form-control">
								<option value="">所有</option>
								<option value="1" <c:if test="${dataStore.type == '1'}">selected="selected"</c:if> >私密布控</option>
								<option value="2" <c:if test="${dataStore.type == '2'}">selected="selected"</c:if> >公开布控</option>
							</select>
							</div>
						</div>
						
						
						<div class="col-lg-2 m-b-sm">
							<div class="input-group">
							<span class="input-group-addon">指令级别:</span>
							<select name="level" class="form-control">
								<option value="">所有</option>
								<option value="1" <c:if test="${dataStore.level == '1'}">selected="selected"</c:if> >一级</option>
								<option value="2" <c:if test="${dataStore.level == '2'}">selected="selected"</c:if> >二级</option>
								<option value="3" <c:if test="${dataStore.level == '3'}">selected="selected"</c:if> >三级</option>
							</select>
							</div>
						</div>
							
						<div class="col-lg-4 m-b-sm" id="data_5">
                            <div class="input-daterange input-group" id="datepicker">
                            	<span class="input-group-addon input-title">开始日期:</span>
                                <input type="text" class="form-control" name="start" value="${dataStore.start}" />
                                <span class="input-group-addon">至</span>
                                <input type="text" class="form-control" name="end" value="${dataStore.end}" />
                            </div>
                        </div>
                    	
                    	<div class="col-lg-4 m-b-sm" id="data_6">
                            <div class="input-daterange input-group" id="datepicker">
                            	<span class="input-group-addon input-title">到期日期:</span>
                                <input type="text" class="form-control" name="start2" value="${dataStore.start2}" />
                                <span class="input-group-addon">至</span>
                                <input type="text" class="form-control" name="end2" value="${dataStore.end2}" />
                            </div>
                        </div>
                    	
                    	<button type="submit" id="search" class="btn btn-info" ><i class="fa fa-search"></i>&nbsp;&nbsp;搜索</button>
                    	</form>
                    	</div>
                    	
                    	<div class="m-b-sm">
                    		<button type="button" class="btn btn-success btn-sm" onclick="add();"><i class="fa fa-plus-circle"></i>&nbsp;&nbsp;添加</button>
                    		<!-- <button type="button" class="btn btn-success btn-sm" onclick="output();"><i class="fa fa-plus-circle"></i>&nbsp;&nbsp;导出</button>
							<button type="button" class="btn btn-success btn-sm" onclick="imput();"><i class="fa fa-plus-circle"></i>&nbsp;&nbsp;导入</button> -->
                    	</div>

						<!-- 列表区 -->
						<div class="m-b-sm">
							<table id="table" data-toggle="table" data-striped="true" >
								<thead>
									<tr>
										<th data-visible="false">id</th>
										<th data-width="2%" data-align="center">序号</th>
										<th data-width="10%">当前状态</th>
										<th data-width="10%">姓名</th>
										<th data-width="15%">证件号码</th>
										<th data-width="10%">布控类型</th>
										<th data-width="10%">指令级别</th>
										<th data-width="15%">申请单位</th>
										<th data-width="10%">开始时间</th>
										<th data-width="10%">到期时间</th>
										<!-- <th data-width="8%" data-align="center">操作</th> -->
									</tr>
								</thead>
								<tbody>
									<c:forEach items="${pageInfo.resultList}" var="item" varStatus="i">
										<tr>
											<td>${item.monitorId}</td>
											<td>${i.index + 1}</td>
											<td>
											<c:choose>
												<c:when test="${item.bkzt == 1}">未布控</c:when>
												<c:when test="${item.bkzt == 2}">已布控</c:when>
												<c:when test="${item.bkzt == 3}">布控到期</c:when>
												<c:when test="${item.bkzt == 4}">延控</c:when>
												<c:when test="${item.bkzt == 5}">已撤控</c:when>
												<c:otherwise>未知状态</c:otherwise>
											</c:choose>
											</td>
											<td>${item.xm}</td>
											<td>${item.zjhm}</td>
											<td>
											<c:choose>
												<c:when test="${item.bklx == 1}">私密布控</c:when>
												<c:when test="${item.bklx == 2}">公开布控</c:when>
												<c:otherwise>未知类型</c:otherwise>
											</c:choose>
											</td>
											<td>
											<c:choose>
												<c:when test="${item.zljb == 1}">一级</c:when>
												<c:when test="${item.zljb == 2}">二级</c:when>
												<c:when test="${item.zljb == 3}">三级</c:when>
												<c:otherwise>未知级别</c:otherwise>
											</c:choose>
											</td>
											<td>${item.sqdw}</td>
											<td><my:DateSubString date="${item.qsrq}" subNum="16"/></td>
											<td><my:DateSubString date="${item.jzrq}" subNum="16"/></td>
											<%-- <td>
												<button type="button" class="btn btn-primary btn-xs" onclick="detail('${item.monitorId}');">详情</button>
												<button type="button" class="btn btn-success btn-xs" onclick="edit('${item.monitorId}');">延控</button>
											</td> --%>
										</tr>
									</c:forEach>
								</tbody>
							</table>
						</div>

						<jsp:include page="../../common/turnPage.jsp" />
					</div>
                </div>
            </div>
            
        </div>

	</div>
    
    <script src="<%=request.getContextPath()%>/views/sysdefault/js/jquery.min.js?v=2.1.4"></script>
    <script src="<%=request.getContextPath()%>/views/sysdefault/js/bootstrap.min.js?v=3.3.5"></script>
    <script src="<%=request.getContextPath()%>/views/sysdefault/js/content.min.js?v=1.0.0"></script>
    <script src="<%=request.getContextPath()%>/views/sysdefault/js/plugins/toastr/toastr.min.js"></script>
    <script src="<%=request.getContextPath()%>/views/sysdefault/js/plugins/layer/layer.js"></script>
    <script src="<%=request.getContextPath()%>/views/sysdefault/js/plugins/bootstrap-table/bootstrap-table.js"></script>
    <script src="<%=request.getContextPath()%>/views/sysdefault/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
    
    <script src="<%=request.getContextPath()%>/views/sysdefault/js/plugins/datapicker/bootstrap-datepicker.js"></script>
    
    <script type="text/javascript">
    
    var basePath = '<%=request.getContextPath()%>';
    
    toastr.options = {
  		  "closeButton": true,
  		  "debug": false,
  		  "progressBar": true,
  		  "positionClass": "toast-top-left",
  		  "showDuration": "400",
  		  "hideDuration": "1000",
  		  "timeOut": "3000",
  		  "extendedTimeOut": "1000",
  		  "showEasing": "swing",
  		  "hideEasing": "linear",
  		  "showMethod": "fadeIn",
  		  "hideMethod": "fadeOut"
  		}
    
    //初始化日期控件
    $("#data_5 .input-daterange").datepicker({
        keyboardNavigation: !1,
        forceParse: !1,
        autoclose: !0
    });
    
  //初始化日期控件
    $("#data_6 .input-daterange").datepicker({
        keyboardNavigation: !1,
        forceParse: !1,
        autoclose: !0
    });
    
    //添加
    var add = function(){
    	location.href="addMonitorLogin.do";
    }
    
    //编辑
    var edit = function(mId){
    	var mainCateId = $("#mainCateId").val();
    	location.href="addNewsLogin.do?newsId="+mId+"&mainCateId="+mainCateId;
    }
    
    //详情
    var detail = function(mId){
    	parent.openUrl(basePath+'/bgPort/newsDetail.do?newsId='+mId, '新闻详情');
    }
    
    //导出
    var output = function(){
    	
    	layer.confirm('确定要导出数据吗？', {
			  btn: ['确定','取消'] //按钮
			}, function(index){
			  
				layer.close(index);
				
				$("#export").submit();
				
			}, function(){
			  
			});
    	
    }
    
    //导入
    var imput = function(){
    	layer.open({
  		  type: 2,
  		  title: '本地关注人员导入',
  		  shadeClose: true,
  		  shade: 0.3,
  		  area: ['800px', '250px'],
  		  content: basePath + '/rlqb/localAttenImportLogin.do' //iframe的url
  		});
    }
    
    /******隐藏/显示新闻******/
	var updateStatus = function(mId,status,word){
		
		layer.confirm('确定要' + word + '该公告吗？', {
			  btn: ['确定','取消'] //按钮
			}, function(index){
			  
				layer.close(index);
				
				$.ajax({
					type : "POST",
					url : basePath + "/bgCzf/updateIsShow.do",
					data : {"ids" : mId, "isShow" : status},
					dataType : "json",
					success : function(msg) { 
						if (msg.errCode == '1') {
							layerCallBack('1');
						}else{
							toastr.error(msg.errMsg, "提示");
						}
					},
					error : function(XMLHttpRequest, textStatus, errorThrown) {
						toastr.error("系统出错！", "提示");
					},
					beforeSend : function(XMLHttpRequest){
						layer.load(0, {
							  shade: [0.3,'#ccc'] //0.1透明度的白色背景
							});
					},
					complete : function(XMLHttpRequest, textStatus){
						layer.closeAll();
					}
				});
				
			}, function(){
			  
			});
		
	}
    
    //操作成功
    var layerCallBack = function(status){
    	if(status == '1'){
    		layer.closeAll();
    		toastr.success("操作成功！", "提示");
    		
    		setTimeout(function(){
    			location.reload();
    		}, 1000);
    		
    	}else if(status == '2'){
    		layer.closeAll();
    		toastr.success("操作成功！", "提示");
    	}
    }
    
    </script>
    
</body>

</html>